<!DOCTYPE html>
<html>

<head>
    <script src="../js/flexible.js"></script>
    <meta charset="UTF-8">
    <title>消息列表</title>
    <link rel="stylesheet" type="text/css" href="../css/common.css">
    <link rel="stylesheet" type="text/css" href="../css/job/index.css">
    <style>
        #pullUp{
            display: none !important;
        }
    </style>
</head>

<body>
    <div class="listSign" id="J_wrapper" style="background:#fff;">
        <div id="scroller">
            <div id="pullDown">
                <span class="pullDownIcon"></span><span class="pullDownLabel">下拉加载</span>
            </div>
            <ul id="details">
            </ul>
            <div id="pullUp">
                <span class="pullUpIcon"></span><span class="pullUpLabel"></span>
            </div>
        </div>
    </div>
    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <script type="text/javascript" src="../js/fastclick.js"></script>
    <script type="text/javascript" src="../js/scroll/iscroll.js"></script>
    <script type="text/javascript" src="../js/scroll/scroll-init.js"></script>
    <script type="text/javascript" src="../js/ajax/jsencrypt.js"></script>
    <script type="text/javascript" src="../js/ajax/ajax.js"></script>
    <script type="text/javascript">
    FastClick.attach(document.body);
    var count_pages = 1;
    var manage_id = 2;
    var stateFlag = false;
    if (GetQueryString("userId")) {
        manage_id = GetQueryString("userId"); //获取当前会话的id
    }
    localStorage.setItem("o_flag", ""); //清除掉详情页缓存的数据
    pullUpAction();

    function pullUpAction() {
        if (stateFlag) {
            return false;
        }
        start.postAjaxReq({
            param: {
                "id": manage_id,
                "page_size": 12,
                "page": count_pages
            },
            type: "GET",
            url: "/message/messageList",
            success: function(data) {
                var meta = data.result.meta;
                var str = ' ',
                    now;
                obj = data.result.data;
                if (obj.length > 0) {
                    count_pages++;
                    for (var i = 0; i < obj.length; i++) {
                        str += '<li data-taskid = "' + obj[i].m_task_id + '">';
                        if (obj[i].m_isread != 1)
                            str += '<img src="../img/dian.png">';
                        str += '<p>' + obj[i].m_content + '</p><a class="listImg"><img src="../img/sanjiao.png"></a></li>';
                    }
                    $("#details").append(str);
                } else {
                    if (count_pages == 1 && obj.length == 0) {
                        html = shoNoData();
                        stateFlag = true;
                    }
                    $(".j_container_wrap:visible").append(html);
                    return false;
                }
                if (meta.current_page == meta.total_pages) {
                    showFadeData();
                    stateFlag = true;
                }

                myScroll.refresh();

            },
            errorCb: function(data) {}
        });
    };

    $("#details").delegate("li", 'click', function() {
        localStorage.setItem("isMsgList", true);
        localStorage.setItem('data_taskId', $(this).data('taskid'));
        location.href = "manager-deta.html";
    });
    </script>
</body>

</html>
